home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / doom / doom-dsp.tgz / doom-dsp.tar / doom-dsp16to8.patch < prev    next >
Text File  |  1994-12-15  |  6KB  |  195 lines

  1. Only in linux.jon/drivers/sound: ad1848.c^
  2. diff -r -u linux/drivers/sound/audio.c linux.jon/drivers/sound/audio.c
  3. --- linux/drivers/sound/audio.c    Mon Jul 18 07:50:55 1994
  4. +++ linux.jon/drivers/sound/audio.c    Fri Dec  9 12:03:44 1994
  5. @@ -173,6 +173,7 @@
  6.    p = 0;
  7.    c = count;
  8.  
  9. +
  10.    if (audio_mode[dev] == AM_READ)    /*
  11.                       * Direction changed
  12.                       */
  13. Only in linux.jon/drivers/sound: audio.c^
  14. Binary files linux/drivers/sound/configure and linux.jon/drivers/sound/configure differ
  15. diff -r -u linux/drivers/sound/dmabuf.c linux.jon/drivers/sound/dmabuf.c
  16. --- linux/drivers/sound/dmabuf.c    Tue Aug 23 07:48:52 1994
  17. +++ linux.jon/drivers/sound/dmabuf.c    Fri Dec  9 12:34:04 1994
  18. @@ -443,7 +443,9 @@
  19.        {
  20.      int             fact = IOCTL_IN (arg);
  21.      int             bytes, count;
  22. +    extern int sb_16bit_fake;
  23.  
  24. +
  25.      if (fact == 0)
  26.        return RET_ERROR (EIO);
  27.  
  28. @@ -452,6 +454,9 @@
  29.        return RET_ERROR (EINVAL);
  30.  
  31.      bytes = fact & 0xffff;
  32. +    if (sb_16bit_fake)
  33. +       bytes--;
  34. +
  35.      count = (fact >> 16) & 0xffff;
  36.  
  37.      if (count == 0)
  38. Only in linux.jon/drivers/sound: dmabuf.c^
  39. Binary files linux/drivers/sound/dmabuf.o and linux.jon/drivers/sound/dmabuf.o differ
  40. Only in linux.jon/drivers/sound: int
  41. diff -r -u linux/drivers/sound/sb_dsp.c linux.jon/drivers/sound/sb_dsp.c
  42. --- linux/drivers/sound/sb_dsp.c    Fri Aug 19 06:54:09 1994
  43. +++ linux.jon/drivers/sound/sb_dsp.c    Fri Dec  9 12:45:07 1994
  44. @@ -40,6 +40,7 @@
  45.  #undef SB_TEST_IRQ
  46.  
  47.  int             sbc_base = 0;
  48. +int        sb_16bit_fake = 1;
  49.  static int      sbc_irq = 0;
  50.  static int      open_mode = 0;    /* Read, write or both */
  51.  
  52. @@ -94,6 +95,27 @@
  53.  
  54.  #if !defined(EXCLUDE_MIDI) || !defined(EXCLUDE_AUDIO)
  55.  
  56. +
  57. +void
  58. +sb_16_8_copy_from_user(int dev, char *localbuf, int localoffs,
  59. +               snd_rw_buf * userbuf, int useroffs, int len)
  60. +{
  61. +  int i;
  62. +  unsigned short in;
  63. +  unsigned char  *out = &localbuf[localoffs];
  64. +
  65. +  if (sb_16bit_fake) {
  66. +    for(i=0;i<len;i++)  {
  67. +       GET_SHORT_FROM_USER (in, (short *) userbuf, useroffs);
  68. +       useroffs ++;
  69. +       in ^= 0x8000;
  70. +       out[i] = (in>>8);
  71. +    }
  72. +  } else {
  73. +      COPY_FROM_USER (&localbuf[localoffs], userbuf, useroffs, len);
  74. +  }
  75. +
  76. +}
  77.  /*
  78.   * Common code for the midi and pcm functions
  79.   */
  80. @@ -739,7 +761,7 @@
  81.  {
  82.    "SoundBlaster",
  83.    NOTHING_SPECIAL,
  84. -  AFMT_U8,            /* Just 8 bits. Poor old SB */
  85. +  AFMT_U8 | AFMT_S16_LE,            /* Just 8 bits. Poor old SB */
  86.    NULL,
  87.    sb_dsp_open,
  88.    sb_dsp_close,
  89. @@ -751,7 +773,7 @@
  90.    sb_dsp_reset,
  91.    sb_dsp_halt_xfer,
  92.    NULL,                /* local_qlen */
  93. -  NULL                /* copy_from_user */
  94. +  sb_16_8_copy_from_user    /* copy_from_user */
  95.  };
  96.  
  97.  #endif
  98. Only in linux.jon/drivers/sound: sb_dsp.c^
  99. Binary files linux/drivers/sound/sb_dsp.o and linux.jon/drivers/sound/sb_dsp.o differ
  100. Binary files linux/drivers/sound/sound.a and linux.jon/drivers/sound/sound.a differ
  101. diff -r -u linux/drivers/sound/sound_config.h linux.jon/drivers/sound/sound_config.h
  102. --- linux/drivers/sound/sound_config.h    Fri Aug 19 06:54:10 1994
  103. +++ linux.jon/drivers/sound/sound_config.h    Fri Dec  9 19:10:17 1994
  104. @@ -193,7 +193,7 @@
  105.  #define SND_DEV_SEQ2    8    /* /dev/sequencer, level 2 interface */
  106.  #define SND_DEV_SNDPROC 9    /* /dev/sndproc for programmable devices */
  107.  #define SND_DEV_PSS    SND_DEV_SNDPROC
  108. -
  109. +#define SND_DEV_DSP16_8    11    /* Like /dev/dsp but emulate 16 bits/sample */
  110.  #define DSP_DEFAULT_SPEED    8000
  111.  
  112.  #define ON        1
  113. Only in linux.jon/drivers/sound: sound_config.h^
  114. diff -r -u linux/drivers/sound/sound_switch.c linux.jon/drivers/sound/sound_switch.c
  115. --- linux/drivers/sound/sound_switch.c    Mon Jul 18 07:50:55 1994
  116. +++ linux.jon/drivers/sound/sound_switch.c    Fri Dec  9 19:23:37 1994
  117. @@ -52,6 +52,7 @@
  118.  static char    *status_buf = NULL;
  119.  static int      status_len, status_ptr;
  120.  static int      status_busy = 0;
  121. +extern int sb_16bit_fake;
  122.  
  123.  static int
  124.  put_status (char *s)
  125. @@ -286,6 +287,7 @@
  126.        break;
  127.  
  128.      case SND_DEV_DSP:
  129. +    case SND_DEV_DSP16_8:
  130.      case SND_DEV_DSP16:
  131.      case SND_DEV_AUDIO:
  132.        return audio_read (dev, file, buf, count);
  133. @@ -316,7 +318,6 @@
  134.  int
  135.  sound_write_sw (int dev, struct fileinfo *file, snd_rw_buf * buf, int count)
  136.  {
  137. -
  138.    DEB (printk ("sound_write_sw(dev=%d, count=%d)\n", dev, count));
  139.  
  140.    switch (dev & 0x0f)
  141. @@ -327,11 +328,13 @@
  142.        return sequencer_write (dev, file, buf, count);
  143.        break;
  144.  
  145. -    case SND_DEV_DSP:
  146. +
  147. +    case SND_DEV_DSP16_8:
  148. +      return (2* audio_write (dev, file, buf, count/2));
  149.      case SND_DEV_DSP16:
  150.      case SND_DEV_AUDIO:
  151. -      return audio_write (dev, file, buf, count);
  152. -      break;
  153. +    case SND_DEV_DSP:
  154. +    return audio_write (dev, file, buf, count);
  155.  
  156.  #ifndef EXCLUDE_MIDI
  157.      case SND_DEV_MIDIN:
  158. @@ -398,10 +401,15 @@
  159.      return retval;
  160.        break;
  161.  #endif
  162. -
  163. -    case SND_DEV_DSP:
  164. +    case SND_DEV_DSP16_8:
  165. +    sb_16bit_fake = 1;
  166. +        if ((retval = audio_open (((dev & 0xfffffff0) | SND_DEV_DSP), file)) < 0)
  167. +        return retval;
  168. +    break;
  169.      case SND_DEV_DSP16:
  170. +    case SND_DEV_DSP:
  171.      case SND_DEV_AUDIO:
  172. +      sb_16bit_fake = 0;
  173.        if ((retval = audio_open (dev, file)) < 0)
  174.      return retval;
  175.        break;
  176. @@ -454,6 +462,7 @@
  177.  
  178.      case SND_DEV_DSP:
  179.      case SND_DEV_DSP16:
  180. +    case SND_DEV_DSP16_8:
  181.      case SND_DEV_AUDIO:
  182.        audio_release (dev, file);
  183.        break;
  184. @@ -501,6 +510,7 @@
  185.  
  186.      case SND_DEV_DSP:
  187.      case SND_DEV_DSP16:
  188. +    case SND_DEV_DSP16_8:
  189.      case SND_DEV_AUDIO:
  190.        return audio_ioctl (dev, file, cmd, arg);
  191.        break;
  192. Only in linux.jon/drivers/sound: sound_switch.c^
  193. Binary files linux/drivers/sound/sound_switch.o and linux.jon/drivers/sound/sound_switch.o differ
  194. Only in linux.jon/drivers/sound: soundcard.c^
  195.